﻿/**
	@file	StateMachine.h
	@date	2013/1/25
	@author	김진식(jeensig@gmail.com)
	@brief	FSM
*/

#ifndef _STATEMACHINE_H_
#define _STATEMACHINE_H_

#include "GameInterface.h"
#include <vector>

class TetrisGame;

/**
	@class	StateMachine
	@date	2013/1/25
	@author	김진식(jeensig@gmail.com)
	@brief	FSM
*/
class StateMachine
{
public:
	enum STATE_NUMBER { START_STATE = 0, PLAY_STATE, END_STATE };

	StateMachine(TetrisGame* owner);
	~StateMachine();

	void Update(); ///< 상태의 Update
	void Render(); ///< 상태의 Render

	void ChangeState(STATE_NUMBER number); ///< 상태 전이
	void SetCurrentState(STATE_NUMBER number); ///< Currnet State 설정

private:

	void SetState(); ///< 처음 State를 세팅

	typedef std::vector<GameInterface*> STATES;
	STATES state_; ///< State들을 관리

	TetrisGame* owner_; ///< 가지고 있는 owner
	GameInterface* current_state_; ///< 현재 상태
};

#endif